package com.lt.experiment03.mission01_1;

public class RootVegetablesFactory {
    public RootVegetables Growingvegetables(String type){
        RootVegetables rv=null;
        if (type.equalsIgnoreCase("豆薯")){
            rv = new SweetPotato();
        }
        if (type.equalsIgnoreCase("大头菜")){
            rv = new Turnip();
        }
        if (type.equalsIgnoreCase("胡萝卜")){
            rv = new Carrot();
        }
        if (type.equalsIgnoreCase("萝卜")){
            rv = new radish();
        }
        if(rv != null){
            return rv;
        }else{
            System.out.println("没有该蔬菜");
        }
        return null;
    }
}
